<%@ page contentType="text/html;charset=ISO8859_1" language="java" 
 import="git.bankview.sl.report.ReportCommon" %>

<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/struts-nested.tld" prefix="nested" %>

<jsp:useBean id="oLogon" class="git.bankview.wl.bean.LogonBean" scope="session" />
<jsp:useBean id="PageTunerForm" type="org.apache.struts.validator.DynaValidatorForm" scope="request" />
<%
	request.setAttribute("request", request);
	java.util.List oAuthMethods = git.bankview.wl.auth.UserAuth.queryMethods(oLogon, request.getParameter("transid"));
%>
<jsp:useBean id="oNavigate" class="git.bankview.wl.bean.TransNavigateBean" />
<jsp:setProperty name="oNavigate" property="transid" />

<html:html locale="true">
<head>
	<title><logic:iterate id="element" name="oNavigate" property="navigateList"
	><bean:write name="element" property="translabel" />
	 - </logic:iterate><bean:message key="reportschdlist.title" /></title>
	<link rel="stylesheet" href="../style/default_aux.css" id="oCssLink">
	<script language="javascript" src="../script/pagetuner.js"></script>
</head>
<body onload="oninit()">
	<script src="/script/overlib.js" language="JavaScript"></script>
	<script src="/script/windows.js" language="JavaScript"></script>
	<table cellspacing="0" class="filledframe">
		<tr>
			<td nowrap="" class="clientframe">
				<html:form action="/report/ReportSchdRecList" styleId="oListForm">
					<bean:parameter id="transid" name="transid" value="" />
					<input type="hidden" name="transid" value="<bean:write name="transid" />" />
					<logic:notEmpty name="PageTunerForm" property="sortIndexes">
						<logic:iterate id="element" name="PageTunerForm" property="sortIndexes">
							<input type="hidden" name="sortIndexes" value="<bean:write name="element" />" />
						</logic:iterate> 
					</logic:notEmpty>
					<html:hidden property="pageIndex" value="0" />
				
					<table class="tabheader" width="90%" >
						<tr id="oToolBar">
							<td align="left" nowrap=""><bean:message key="common.page" 
								arg0="<%=String.valueOf(PageTunerForm.get("pageIndex"))%>"
								arg1="<%=String.valueOf(PageTunerForm.get("totalPages"))%>"
								arg2="<%=String.valueOf(PageTunerForm.get("totalRows"))%>" /></td>
							<td align="left" nowrap="">&nbsp;</td>
							<% if (oAuthMethods.contains(new Integer(ReportCommon.METHOD_MODIFY))) 
								{%><td align="right" width="3%" nowrap=""><a href="javascript: onDeleteReportSchd(); "><html:img src="/images/msdelete.gif" altKey="report.delSchd" /></a></td><% } %>
							<% if (oAuthMethods.contains(new Integer(ReportCommon.METHOD_OWNER))) 
								{%><td align="right" width="3%" nowrap=""><a href="javascript: onSetTransAuth(); "><html:img src="/images/roles0.gif" altKey="report.setTransAuth" /></a></td><% } %>
							<% if (oAuthMethods.contains(new Integer(ReportCommon.METHOD_USE))) 
								{%><td align="right" width="3%" nowrap=""><a href="javascript: onNewManualSchd(); "><html:img src="/images/addschd.gif" altKey="report.newManualSchd" /></a></td><% } %>
							<td align="right" width="3%" nowrap=""><a href="<html:rewrite action="/report/ReportSchdRecList" name="request" property="parameterMap" />"><html:img src="/images/msrefresh.gif" altKey="common.refresh" /></a></td>
							<td align="right" width="3%" nowrap=""><a href="javascript: window.print(); "><html:img src="/images/prints.gif" altKey="common.print" titleKey="common.pageprint.title" /></a></td>
						</tr>
					</table>
					
					<table id="oCube" width="90%" cellspacing="0" class="listpanel">
						<tr class="layer00">
							<td class="typel" nowrap >&nbsp;</td>
							<td class="type" nowrap ><a href="javascript:sortBy(oListForm, 1)"><bean:message key="dqreportschd.schdid" /></a> <script>drawSortFlag(oListForm, 1)</script></td>
							<td class="type" nowrap ><a href="javascript:sortBy(oListForm, 11)"><bean:message key="dqreportschd.grpdeptno" /></a><script>drawSortFlag(oListForm, 11)</script
							>/<a href="javascript:sortBy(oListForm, 13)"><bean:message key="dqreportschd.grpuserid" /></a> <script>drawSortFlag(oListForm, 13)</script></td>
							<td class="type" nowrap ><a href="javascript:sortBy(oListForm, 12)"><bean:message key="dqreportschd.grpschddate" /></a> <script>drawSortFlag(oListForm, 12)</script></td>
							<td class="type" nowrap ><a href="javascript:sortBy(oListForm, 4)"><bean:message key="dqreportschd.schdtype" /></a> <script>drawSortFlag(oListForm, 4)</script></td>
							<td class="type" nowrap ><a href="javascript:sortBy(oListForm, 6)"><bean:message key="dqreportschd.schdstatus" /></a> <script>drawSortFlag(oListForm, 6)</script></td>
							<td class="type" nowrap ><a href="javascript:sortBy(oListForm, 7)"><bean:message key="dqreportschd.exectime" 
							/></a><script>drawSortFlag(oListForm, 7)</script>/<a href="javascript:sortBy(oListForm, 8)"><bean:message key="dqreportschd.termtime" 
							/></a><script>drawSortFlag(oListForm, 8)</script></td>
							<!-- td class="type" nowrap ><a href="javascript:sortBy(oListForm, 9)"><bean:message key="dqreportschd.execmsg" /></a> <script>drawSortFlag(oListForm, 9)</script></td -->
							<td class="typer" nowrap ><a href="javascript:sortBy(oListForm, 5)"><bean:message key="common.operation" /></a> <script>drawSortFlag(oListForm, 5)</script></td>
						</tr>
						<logic:iterate id="element" name="listResult">
						<tr class="layer<bean:write name="element" property="style" />">
							<td class="ctrl" nowrap ><input type="checkbox" name="schdid" value="<bean:write name="element" property="schdid" />" ondblclick="reverseAllState(this)"></td>
							<td class="type1" nowrap ><bean:write name="element" property="schdid" /></td>
							<td class="type0" nowrap ><bean:write name="element" property="grpdeptno" />
								<logic:notEqual name="element" property="grpdeptnos" value=""
									><a href="#" title="<bean:write name="element" property="grpdeptnos" />"><bean:write name="element" property="grpdeptnos_s" /></a></logic:notEqual>
								<bean:write name="element" property="grpuserid" /></td>
							<td class="type3" nowrap ><bean:write name="element" property="grpschddate" /></td>
							<td class="type0" nowrap >
								<logic:equal name="element" property="schdtype" value="0"><bean:message key="dqreportschd.schdtype.d0" /></logic:equal
								><logic:equal name="element" property="schdtype" value="1"><bean:message key="dqreportschd.schdtype.d1" /></logic:equal
								><logic:equal name="element" property="schdtype" value="5"><bean:message key="dqreportschd.schdtype.d5" /></logic:equal
								><logic:equal name="element" property="schdtype" value="7"><bean:message key="dqreportschd.schdtype.d7" /></logic:equal
								><logic:equal name="element" property="schdtype" value="10"><bean:message key="dqreportschd.schdtype.d10" /></logic:equal
								><logic:equal name="element" property="schdtype" value="15"><bean:message key="dqreportschd.schdtype.d15" /></logic:equal
								><logic:equal name="element" property="schdtype" value="30"><bean:message key="dqreportschd.schdtype.d30" /></logic:equal
								><logic:equal name="element" property="schdtype" value="90"><bean:message key="dqreportschd.schdtype.d90" /></logic:equal
								><logic:equal name="element" property="schdtype" value="180"><bean:message key="dqreportschd.schdtype.d180" /></logic:equal
								><logic:equal name="element" property="schdtype" value="360"><bean:message key="dqreportschd.schdtype.d360" /></logic:equal
								><logic:notEqual name="element" property="grpschduser" value="system">[<a href="#" title="<bean:message key="dqreportschd.grpschduser" />: <bean:write name="element" property="grpschduser" />"><bean:message key="dqreportschd.schdtype.manual" /></a>]</logic:notEqual
								><logic:equal name="element" property="grpschduser" value="system">[<bean:message key="dqreportschd.schdtype.auto" />]</logic:equal>
							</td>
							<td class="type0" nowrap >
								<logic:equal name="element" property="schdstatus" value="0"><bean:message key="dqreportschd.schdstatus.readyToRun" /></logic:equal
								><logic:equal name="element" property="schdstatus" value="1"><bean:message key="dqreportschd.schdstatus.running" /></logic:equal
								><logic:equal name="element" property="schdstatus" value="2"><bean:message key="dqreportschd.schdstatus.ok" /></logic:equal
								><logic:equal name="element" property="schdstatus" value="8"><bean:message key="dqreportschd.schdstatus.readyToDelete" /></logic:equal
								><logic:equal name="element" property="schdstatus" value="9"><bean:message key="dqreportschd.schdstatus.deleted" /></logic:equal
								><logic:lessThan name="element" property="schdstatus" value="0"
								><a href="#" title="<bean:message name="element" property="execmsg" />"><bean:message key="dqreportschd.schdstatus.failed" 
								/></a>(<a href="#" title="<bean:write name="element" property="execdetail_s" />"><bean:write name="element" property="schdstatus" 
								/></a>)</logic:lessThan>
							</td>
							<td class="type3" nowrap ><logic:equal name="element" property="termtime" value=""
								><bean:write name="element" property="exectime" formatKey="common.format.datetime" /></logic:equal
								><logic:notEqual name="element" property="termtime" value=""
								><bean:write name="element" property="termtime" formatKey="common.format.datetime" /></logic:notEqual
								></td>
							<!-- td class="type0" nowrap ><a href="#" title="<bean:write name="element" property="execdetail_s" />"><bean:message name="element" property="execmsg" /></a></td -->
							<td class="type0" nowrap >
								<%-- if (oAuthMethods.contains(new Integer(ReportCommon.METHOD_USE))) 
								{ --%><a href="javascript: onReschdReport(<bean:write name="element" property="schdid" />); "><html:img src="/images/mscopy.gif" altKey="report.reschd" /></a><%-- } --%>
								<%
									Object oSchdstatus = ((java.util.Map)element).get("schdstatus");
									if (new Integer(2).equals(oSchdstatus) || new Integer(-20).equals(oSchdstatus))
									{ %><a href="/SchdDownload/<bean:write name="element" property="schdid" format="00000000" />.<bean:write name="element" property="schdexport" />" target="_blank"
									><logic:equal name="element" property="schdexport" value="XLS"><html:img src="/images/excels.gif" altKey="dqreportschd.schdexport.xls" 
									/></logic:equal><logic:equal name="element" property="schdexport" value="PDF"><html:img src="/images/pdfs.gif" altKey="dqreportschd.schdexport.pdf" 
									/></logic:equal><logic:equal name="element" property="schdexport" value="XML"><html:img src="/images/xmls.gif" altKey="dqreportschd.schdexport.xml" 
									/></logic:equal><logic:equal name="element" property="schdexport" value="HTM"><html:img src="/images/htmls.gif" altKey="dqreportschd.schdexport.htm" 
									/></logic:equal><logic:equal name="element" property="schdexport" value="CSV"><html:img src="/images/csvs.gif" altKey="dqreportschd.schdexport.csv" 
								/></logic:equal></a><% } %></td></tr>
						</logic:iterate>
					</table>
					<table class="tabfooter" width="90%" >
						<tr>
							<% if (oAuthMethods.contains(new Integer(ReportCommon.METHOD_MODIFY))) 
								{%><td align="left" width="5%" nowrap=""><input type="button" class="button" onclick="onModifyReportTrans(); " value="<bean:message key="report.modifyReportTrans" />" ></td><% } %>
							<% if (oAuthMethods.contains(new Integer(ReportCommon.METHOD_OWNER))) 
								{%><td align="left" width="5%" nowrap=""><input type="button" class="button" onclick="onDeleteReportTrans(); " value="<bean:message key="report.delTrans" />" ></td><% } %>
							<td align="left" nowrap=""></td>
							<td align="right" width="30%" nowrap="" id="oPageNavigator"></td>
							<td align="right" width="5%" nowrap=""> <bean:message key="common.rowsperpage.prefix" /></td>
							<td align="right" width="2%" nowrap=""><html:text property="rowsPerPage" size="2" /></td>
							<td align="right" width="5%" nowrap=""><bean:message key="common.rowsperpage.postfix" /></td>
						</tr>
					</table>
				</html:form>
			</td>
			<!-- td id="oFrame" nowrap="" class="infoframe" rowspan="2">&nbsp;</td -->
		</tr>
	</table>
	
	<html:form action="/report/ManualReportSchdStart" styleId="oManualReportSchdHelperForm" target="_parent">
		<input type="hidden" name="transid" value="<bean:write name="transid" />" />
		<input type="hidden" name="pageUrl" value="<html:rewrite action="/report/ReportSchdList" name="request" property="parameterMap" />" />
	</html:form>
	<html:form action="/report/DeleteReportTransStart" styleId="oDeleteReportTransHelperForm" target="_parent">
		<input type="hidden" name="transid" value="<bean:write name="transid" />" />
	</html:form>
	<html:form action="/report/DeleteReportSchdStart" styleId="oDeleteReportSchdHelperForm" target="_parent">
		<input type="hidden" name="pageUrl" value="<html:rewrite action="/report/ReportSchdList" name="request" property="parameterMap" />" />
	</html:form>
	<html:form action="/report/ReschdReport" styleId="oReschdReportHelperForm" target="_parent">
		<input type="hidden" name="schdid" value="" />
		<input type="hidden" name="transid" value="<bean:write name="transid" />" />
		<input type="hidden" name="pageUrl" value="<html:rewrite action="/report/ReportSchdList" name="request" property="parameterMap" />" />
	</html:form>
	<form action="<html:rewrite action="/report/UploadMainJasperForUpdateForm.do" />" id="oUpdateReportTransHelperForm" target="_parent">
		<input type="hidden" name="transid" value="<bean:write name="transid" />" />
		<input type="hidden" name="translabel" value="<bean:write name="translabel" />" />
	</form>
	<html:form action="/report/SetTransAuthStart" styleId="oSetTransAuthHelperForm" target="_parent">
		<input type="hidden" name="transid" value="<bean:write name="transid" />" />
	</html:form>
	<html:form action="/report/UploadInputForm" styleId="oUploadInputHelperForm" target="_parent">
		<input type="hidden" name="transid" value="<bean:write name="transid" />" />
	</html:form>
<script language="javascript">
	
function oninit()
{
	var nTotalPages = <bean:write name="PageTunerForm" property="totalPages" />;
	var nPageIndex = <bean:write name="PageTunerForm" property="pageIndex" />;
	
	addPageTuner(oToolBar, oListForm.pageIndex, nPageIndex, nTotalPages);
	addPageNavigator(oPageNavigator, oListForm.pageIndex, nPageIndex, nTotalPages);
}
function reverseAllState(c)
{
	var flag = c.checked;
	if (undefined != oListForm.schdid.length)
	{
		var i;
		for (i = 0; i < oListForm.schdid.length; ++i)
		{
			oListForm.schdid[i].checked = flag;
		}
	}
}
function onUploadInput()
{
	oUploadInputHelperForm.submit();
}
function onDeleteReportTrans()
{
	if (confirm("<bean:message key="report.delTransConfirm" arg0="" arg1="" />"))
		oDeleteReportTransHelperForm.submit();
}
function onModifyReportTrans()
{
	oUpdateReportTransHelperForm.submit();
}
function onSetTransAuth()
{
	oSetTransAuthHelperForm.submit();
}

function onDeleteReportSchd()
{
	var vSelected = getCheckValues(oListForm.schdid);
	if (0 == vSelected.length)
	{
		alert('<bean:message key="common.err.minSelect" arg0="1" />');
	}
	else if (confirm("<bean:message key="report.delSchdConfirm" />"))
	{
		appendHiddenFields(oDeleteReportSchdHelperForm, 'schdid', vSelected);
		oDeleteReportSchdHelperForm.submit();
	}
}
function onNewManualSchd()
{
	oManualReportSchdHelperForm.submit();
}
function onReschdReport(sid)
{
	oReschdReportHelperForm.schdid.value = sid;
	oReschdReportHelperForm.submit();
}
</script>
<script for="window" event="onbeforeprint">document.all.oCssLink.href = "../style/default_auxp.css";</script>
<script for="window" event="onafterprint">document.all.oCssLink.href = "../style/default_aux.css";</script>
</body>
</html:html>










